package Euler38;

public class PandigitalMultiples {
	public static void main(String[] args) {
		
		for(int i = 1; i < 9999; i++)
		{
			String num = "";
			int mult = 1;
			while(num.length()<9)
			{
				num += i*mult;
				mult++;
			}
			
			if(num.length() == 9)
			{
				if(isPandigital(num))
				{
					System.out.println("i is: " + i +", pandigital is: " + num);
				}
			}
		}
	}
	
	static boolean isPandigital(String number)
	{
		if(number.length()>9)
		{
			return false;
		}
		for(int i = 1; i <= number.length(); i++)
		{
			if(!number.contains(String.valueOf(i)))
			{
				return false;
			}
		}
		return true;
	}
}
